﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DisplayBoardInfo.Server.Entities
{
    class Roles
    {
        #region Factory methods

        #endregion

        #region Helper methods

        /// <summary>
        /// Checks is specyfic role exist.
        /// </summary>
        /// <param name="roleName">Name of role</param>
        /// <returns>Returns true if role exists or false otherwise</returns>
        public static bool IsRoleExists(string roleName)
        {
            Model.DatabaseContextDataContext db = new Model.DatabaseContextDataContext();
            return db.Roles.Where(i => i.Name == roleName).Count() > 0;
        }

        #endregion
    }
}
